var net = require("net");

var host = "localhost";
var port = 8088;

// var server = net.createServer(...)

var server = net.createServer(
    function(socket) {
	socket.write("Echo Server\r\n");
	socket.on("data", function(data) {
	    socket.write(data);
	});
	socket.on("end", function() {
	    socket.end("Bye-Bye!\r\n");
	});
    }).listen(port, host);

// NOTE: socket.on("data", ...); or socket.addListener("data", ...);

console.log("Echo Server running at host " + host + " port " + port);
